#include<bits/stdc++.h>
using namespace std;
const int V = 1000000000;
typedef struct{
	int ls,rs,mn,mncnt,len,tag;
}Tree;
Tree t[10000011];
int idx;
void Add(int& p,int k,int len)
{
	if(!p)
		t[++idx] = t[0],p = idx,t[p].mncnt = len;
	t[p].mn += k,t[p].tag += k;
}
void push_down(int p,int l,int r)
{
	int mid = l + r >> 1;
	Add(t[p].ls,t[p].tag,mid - l + 1),Add(t[p].rs,t[p].tag,r - mid);
	t[p].tag = 0;
}
void push_up(int p)
{
	t[p].mn = min(t[t[p].ls].mn,t[t[p].rs].mn);
	t[p].mncnt = (t[t[p].ls].mn == t[p].mn) * t[t[p].ls].mncnt + (t[t[p].rs].mn == t[p].mn) * t[t[p].rs].mncnt;
}
void add(int& p,int l,int r,int ll,int rr,int k)
{
	if(!p)
		t[++idx] = t[0],p = idx,t[p].mncnt = rr - ll + 1;
	if(l <= ll && rr <= r)
		return Add(p,k,rr - ll + 1);
	push_down(p,ll,rr);
	int mid = ll + rr >> 1;
	if(l <= mid)
		add(t[p].ls,l,r,ll,mid,k);
	if(mid < r)
		add(t[p].rs,l,r,mid + 1,rr,k);
	push_up(p);
}
int sid;
int n,q;
typedef struct{
	int d,l,r,k;
}AD;
bool cmp(AD A,AD B)
{
	return A.d < B.d;
}
AD e[200011];
AD u[100011],d[100011];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("dierti.in","r",stdin);
	freopen("dierti.out","w",stdout);
	cin >> sid;
	cin >> n >> q;
	for(int i = 1;i <= n;i++)
	{
		int l,r;
		cin >> l >> u[i].d;
		cin >> r >> d[i].d;
		u[i].k = 1,d[i].k = -1;
		u[i].l = d[i].l = l,u[i].r = d[i].r = r - 1;
	}
	while(q--)
	{
		int l,r,id = 0;
		cin >> l >> r;
		for(int i = l;i <= r;i++)
			e[++id] = u[i],e[++id] = d[i];
		sort(e + 1,e + id + 1,cmp);
		int rt = idx = 0;
		int lp = 0;
		long long ans = 0;
		for(int i = 1;i <= id;i++)
		{
			if(rt)
				ans += 1ll * (V - t[rt].mncnt) * (e[i].d - lp);
			lp = e[i].d;
			add(rt,e[i].l,e[i].r,1,V,e[i].k);
		}
		cout << ans << "\n";
	}
	return 0;
}
//我有一个绝妙的做法，但是时间太紧，写不完了